repo.or.cz
/
andmenj-acm.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Solving 10385 - Duathlon (Ternary search)
[andmenj-acm.git]
/
10302 - Summation of polynomials
/
a.cpp
blob
31c2ebb5d81084f951df009f9aa89c3014fa7be7
1
/*
2
Sebastian Arcila Valenzuela
3
sebastianarcila@gmail.com
4
2009
5
@(#)TEMPLATE.c.tpl
6
*/
7
#include <stdio.h>
8
typedef
unsigned long long
ull
;
9
int
main
()
10
{
11
for
(
ull x
,
ans
;
scanf
(
"%llu"
,&
x
) ==
1
;
printf
(
"%llu
\n
"
,
ans
*
ans
))
12
if
((
x
&
1
))
13
ans
= (
x
+
1
)/
2
*
x
;
14
else
15
ans
=
x
/
2
*(
x
+
1
);
16
17
return
0
;
18
}
19